export const getToken = () => {
    // 获取token
    let arr = document.cookie.split(';').find(item => {
        return item.indexOf('starsystemtoken') !== -1
    })
    if (arr) {
        let cookie = document.cookie.split(';').find(item => {
            return item.indexOf('starsystemtoken') !== -1
        }).split('=')[1]
        return cookie
    } else {
        return null
    }
}
export const setToken = (token) => {
    // 设置token
    document.cookie = `starsystemtoken=Bearer ${token}`
}
export const setUserInfo = (data) => {
    localStorage.setItem('userInfo', JSON.stringify(data))
}
export const getUserInfo = () => {
    return JSON.parse(localStorage.getItem('userInfo'))
}